<?php
class member extends  CI_Controller {
 
function __construct()
    {
		parent::__construct();
    }
 
function index()
	{
		$this->load->helper('form');
		$this->load->helper('url');
		$this->load->model('m_member','',TRUE);
		$data['query']=$this->m_member->listmember();
		$data['userid']=$this->uri->segment(3);
		$this->load->view('member',$data);
    }
function add()
	{
		$this->load->helper('url');
		$this->load->model('m_member','',TRUE);
		$this->m_member->addmember();
		redirect('member/index','refresh');
    }
function del()
	{
		$this->load->helper('url');
		$userid=$this->uri->segment(3);
		$this->load->model('m_member','',TRUE);
		$data=$this->m_member->deletemember($userid);
		if($data){
			redirect('member/index','refresh');
		}
    }
function update(){
		$this->load->helper('url');
		$userid=$this->security->xss_clean($this->input->post('userid'));
		$this->load->model('m_member','',TRUE);
		$data=$this->m_member->updatemember($userid);
		if($data){
			redirect('member/index','refresh');
		}
	}
function thanks()
	{
		echo "<h1>Thank you !</h1>";
	}
}
?>